﻿Imports FarPoint.Web.Spread
Imports FarPoint.Web

Imports AjaxControlToolkit
Imports Tohto.Base.CommonConst
Imports Tohto.Base.ComUtility
Imports Tohto.Base.DBUtility
Imports Tohto.Base.Entity
Imports Tohto.Web.BLL

Public Class KJ0030P01
    Inherits CMBasePage

#Region "定数"
    ''' <summary>
    ''' 画面名称
    ''' </summary>
    ''' <remarks></remarks>
    Private Const PAGE_NM As String = "工事一括完了.csv"

    ''' <summary>
    ''' 戻る
    ''' </summary>
    ''' <remarks></remarks>
    Public goBack As String = String.Empty

    ''' <summary>
    ''' 画面ID
    ''' </summary>
    ''' <remarks></remarks>
    Private Const PAGE_ID As String = "KJ0030P01"

    ''' <summary>
    ''' 工事チェッカーテーブル
    ''' </summary>
    ''' <remarks></remarks>
    Private Const KOJITYEKA_TABLE As String = "_KOJITYEKA_TABLE"
#End Region

#Region "ボタンクリックイベント"
    ''' <summary>
    ''' 検索ボタンを押下する場合
    ''' </summary>
    ''' <param name="sender"></param>
    ''' <param name="e"></param>
    ''' <remarks></remarks>
    Protected Sub btn_search_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btn_search.Click
        Try

            Call MyBase.ErrMsgAreaClear()

            '伝票一覧データ取得を呼び出し、結果を取得する。
            Call GetData()

            '画面を遷移する、ページの値をテーブルに保存する　
            Dim gamenValue As DataTable = SaveFormValue()
            Session.Add(ComConst.GAMEN_ID.KOUJI_ANKEN_NYURYOKU & KOJITYEKA_TABLE, gamenValue)

        Catch ex As Exception
            MyBase.ProcessException(ex, ComConst.EX_HANLDER_UI)
        End Try
    End Sub

    ''' <summary>
    ''' クリアボタンを押下する場合
    ''' </summary>
    ''' <param name="sender"></param>
    ''' <param name="e"></param>
    ''' <remarks></remarks>
    Protected Sub but_clear_Click(ByVal sender As Object, ByVal e As EventArgs) Handles but_clear.Click
        Try

            '画面のクリア
            Call PageClear()

        Catch ex As Exception
            MyBase.ProcessException(ex, ComConst.EX_HANLDER_UI)
        End Try
    End Sub

    ''' <summary>
    ''' CSVボタンを押下する場合
    ''' </summary>
    ''' <param name="sender"></param>
    ''' <param name="e"></param>
    ''' <remarks></remarks>
    Protected Sub btn_csv_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btn_csv.Click
        Try

            Call MyBase.ErrMsgAreaClear()

            'CSVファイルに出力する。
            Dim scmMain As ToolkitScriptManager = DirectCast(DirectCast(Me.Master, MainMaster).FindControl("scmMain"), ToolkitScriptManager)
            Dim needCsv As HiddenField = DirectCast(DirectCast(Me.Master, MainMaster).FindControl("hidNeedCsv"), HiddenField)
            Call scmMain.RegisterDataItem(needCsv, "true")

            Session.Add(ComConst.SEE_CSV_SPREADVIEW, Me.KOJI_IKKATU.ActiveSheetView)
            Session.Add(ComConst.SEE_CSV_FILENM, PAGE_NM)

        Catch ex As Exception
            MyBase.ProcessException(ex, ComConst.EX_HANLDER_UI)
        End Try
    End Sub

    ''' <summary>
    ''' 一括完了
    ''' </summary>
    ''' <param name="sender"></param>
    ''' <param name="e"></param>
    ''' <remarks></remarks>
    Protected Sub BatchComplete_Click(sender As Object, e As EventArgs) Handles BatchComplete.Click
        Dim rownum(KOJI_IKKATU.Rows.Count - 1) As Integer
        KOJI_IKKATU.SaveChanges()

        For i As Integer = 0 To KOJI_IKKATU.Rows.Count - 1
            If CType(KOJI_IKKATU.Cells(i, 0).Value, Integer) = 1 Then
                rownum(i) = 1
            Else
                rownum(i) = 0
            End If
        Next

        Dim sessionUserInfo As SessionUserInfo = DirectCast(Session(ComConst.SEE_USER_INFO), SessionUserInfo)

        Dim finishdate As String = CDate(finishdt.Text).ToShortDateString
        Dim siharai As String = CDate(finishdt.Text).ToShortDateString      '支払予定日

        Dim TableTrans As DataTable = Transdata(rownum)

        Dim kj0030 As New KJ0030B01
        kj0030.SAVE_DATA(sessionUserInfo.EMPLOYEE_CD, finishdate, siharai, TableTrans, errInfo)

    End Sub

    ''' <summary>
    ''' Spread
    ''' </summary>
    ''' <param name="sender"></param>
    ''' <param name="e"></param>
    ''' <remarks></remarks>
    Protected Sub KOJI_IKKATU_ButtonCommand(sender As Object, e As FarPoint.Web.Spread.SpreadCommandEventArgs) Handles KOJI_IKKATU.ButtonCommand

        Try

            Dim intRow As Integer = DirectCast(e.CommandArgument, System.Drawing.Point).X
            Dim intCol As Integer = DirectCast(e.CommandArgument, System.Drawing.Point).Y

            If intCol = 5 Then

                Dim dt As DataTable = datatablerec()
                Dim kojino As String = CStr(dt.Rows(intRow).Item("koji_no"))

                Response.Redirect(ComConst.GAMEN_ID.KOUJI_ANKEN_NYURYOKU & ".aspx?" & _
                                  ComConst.GAMEN_MODE & "=" & Server.UrlDecode(ComConst.MODE_EDITABLE) & "&" & _
                                  ComConst.QUERY_KOJI_NO & "=" & Server.UrlDecode(kojino), False)
            End If
        Catch ex As Exception
            MyBase.ProcessException(ex, ComConst.EX_HANLDER_UI)
        End Try

    End Sub

#End Region

#Region "フォームロードイベント"
    ''' <summary>
    ''' フォームロード
    ''' </summary>
    ''' <param name="sender"></param>
    ''' <param name="e"></param>
    ''' <remarks></remarks>
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        'ページ名称をセット
        DirectCast(Me.Master, MainMaster).pageName = PAGE_NM

        Try

            'エラーメッセージリストの初期化
            Call ErrMessageInit()

            If Not IsPostBack Then

                '画面の初期化
                Call PageInit()

                If MyBase.isGoBack Then
                    '遷移先から戻る場合
                    Call GoBackInputInit()

                    '伝票一覧を呼び出し
                    Call GetData()
                End If

            End If

        Catch ex As Exception
            MyBase.ProcessException(ex, ComConst.EX_HANLDER_UI)
        End Try
    End Sub
#End Region

#Region "ソメッド"
    ''' <summary>
    ''' エラーメッセージリストの初期化
    ''' </summary>
    ''' <remarks></remarks>
    Private Sub ErrMessageInit()

        '回収予定日(From)＞回収予定日(To)の場合はエラーとする。
        arrErrorCdList.Add("CME0033")

        'クライアントにポープメッセージ共通をレジスト
        MyBase.RegistErrorCdToForm()
    End Sub

    ''' <summary>
    ''' 画面の初期化
    ''' </summary>
    ''' <remarks></remarks>
    Private Sub PageInit()
        '共通ボタンのリセット
        SetComBtnState(False, False, False, False, False)

        '端末情報の制御
        Call MyBase.SetTanmatuState(False, False)

        '戻る
        Call SetGoBackUrl(Request, PAGE_ID)

        '画面クリア
        Call PageClear()

        'コンボをセット
        Call SetCmbBox()

        '日付フォーカスイベントをセット
        MyBase.RegistHidukeScript(TEHAI_DTF, True)     '手配日(From)
        MyBase.RegistHidukeScript(TEHAI_DTT, True)       '手配日(To)
        MyBase.RegistHidukeScript(HACCHU_DTF, True)    '発注日(From)
        MyBase.RegistHidukeScript(HACCHU_DTT, True)      '発注日(To)
        MyBase.RegistHidukeScriptForFromTo(TEHAI_DTF, TEHAI_DTT)
        MyBase.RegistHidukeScriptForFromTo(HACCHU_DTF, HACCHU_DTT)

        'スプレッドＣＳＳ
        MyBase.SetSpreadDefaultStyle(Me.KOJI_IKKATU, True, True, True)
        KOJI_IKKATU.SaveChanges()

    End Sub

    ''' <summary>
    ''' 画面のクリア
    ''' </summary>
    ''' <remarks></remarks>
    Private Sub PageClear()

        'エラーメッセージ領域のクリア
        Call MyBase.ErrMsgAreaClear()

        Me.ddl_post_cd.SelectedValue = MyBase.sessionUserInfo.POST_CD
        Me.txt_tanto_cd.Text = MyBase.sessionUserInfo.EMPLOYEE_CD
        Me.txt_tanto_nm.Text = MyBase.sessionUserInfo.NM_KANJI_CONNECTION
        Me.ddl_kouji_st.SelectedValue = "00"                                                     '工事案件状態
        Me.TEHAI_DTF.Text = MyBase.GetSystemDate.ToShortDateString
        Me.TEHAI_DTT.Text = MyBase.GetSystemDate.ToShortDateString
        Me.HACCHU_DTF.Text = MyBase.GetSystemDate.ToShortDateString
        Me.HACCHU_DTT.Text = MyBase.GetSystemDate.ToShortDateString
        Me.gyosha_cd.Text = String.Empty
        Me.gyosha_nm.Text = String.Empty

        Me.KOJI_IKKATU.ActiveSheetView.RowCount = 0                                             '工事チェッカ

        Me.KOJI_IKKATU.Focus()                                                                   '部署

    End Sub

    ''' <summary>
    ''' コンボボックスをセット
    ''' </summary>
    ''' <remarks></remarks>
    Private Sub SetCmbBox()

        'コンボボックス初期化
        Call InitDropDownList(ComConst.CMB_BUSYO, ddl_post_cd)
        Call InitDropDownList(ComConst.CMB_KB, ddl_koji_kb, ComConst.KUBUN.KJ001)       '工事区分
        Call InitDropDownList(ComConst.CMB_KB, ddl_kouji_st, ComConst.KUBUN.KJ007)      '工事案件状態

    End Sub

    ''' <summary>
    ''' 一覧データ取得を呼び出し、結果を取得する。
    ''' </summary>
    ''' <remarks></remarks>
    Private Sub GetData()
        '伝票一覧データを取得します。
        Dim dataReceived As DataTable
        dataReceived = datatablerec()

        SpreadInit(dataReceived)

    End Sub

    ''' <summary>
    ''' Fetch Data
    ''' </summary>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Private Function datatablerec() As DataTable
        Dim kj0030 As New KJ0030B01

        Dim sessionUserInfo As SessionUserInfo = DirectCast(Session(ComConst.SEE_USER_INFO), SessionUserInfo)

        Dim dsRet As DataSet = kj0030.Fetch_LIST(sessionUserInfo.EMPLOYEE_CD _
                                                      , Me.ddl_post_cd.SelectedValue _
                                                      , Me.txt_tanto_cd.Text _
                                                      , Me.ddl_koji_kb.SelectedValue _
                                                      , Me.TEHAI_DTF.Text _
                                                      , Me.TEHAI_DTT.Text _
                                                      , Me.HACCHU_DTF.Text _
                                                      , Me.HACCHU_DTT.Text _
                                                      , Me.ddl_kouji_st.SelectedValue _
                                                      , CStr(Me.chk_kouji.Checked) _
                                                      , errInfo)
        Return dsRet.Tables("KOJI_IKKATU")

    End Function

    ''' <summary>
    ''' 手配履歴画面の初期化
    ''' </summary>
    ''' <remarks></remarks>
    Private Sub SpreadInit(ByVal dtTmp As DataTable)

        KOJI_IKKATU.SaveChanges()
        Dim spChkBtn As Spread.CheckBoxCellType = Nothing
        Dim spLink As New Spread.ButtonCellType

        Me.KOJI_IKKATU.Rows.Count = 0
        Me.KOJI_IKKATU.Rows.Count = dtTmp.Rows.Count

        For i As Integer = 0 To dtTmp.Rows.Count - 1


            spChkBtn = New Spread.CheckBoxCellType
            KOJI_IKKATU.Cells(i, 0).CellType = spChkBtn
            KOJI_IKKATU.Cells(i, 0).HorizontalAlign = HorizontalAlign.Center
            KOJI_IKKATU.Cells(i, 0).VerticalAlign = VerticalAlign.Middle

            spLink = New Spread.ButtonCellType
            spLink.ButtonType = Spread.ButtonType.LinkButton
            spLink.Text = Util.ObjToString(dtTmp.Rows(i).Item("KOJI_NO"))            '工事No.
            Me.KOJI_IKKATU.ActiveSheetView.Cells(i, 5).CellType = spLink
            KOJI_IKKATU.Cells(i, 5).HorizontalAlign = HorizontalAlign.Center
            KOJI_IKKATU.Cells(i, 5).VerticalAlign = VerticalAlign.Middle



            Me.KOJI_IKKATU.Cells(i, 1).Value = dtTmp.Rows(i).Item("GYOSHA_CD")          '業者CD
            Me.KOJI_IKKATU.Cells(i, 2).Value = dtTmp.Rows(i).Item("GYOSHA_NM")          '業者名
            If Not IsDBNull(dtTmp.Rows(i).Item("TEHAI_DT")) Then
                Me.KOJI_IKKATU.Cells(i, 3).Value = CDate(dtTmp.Rows(i).Item("TEHAI_DT")).ToShortDateString           '手配日
            Else
                Me.KOJI_IKKATU.Cells(i, 3).Value = Nothing
            End If
            If Not IsDBNull(dtTmp.Rows(i).Item("HACCHU_DT")) Then

                Me.KOJI_IKKATU.Cells(i, 4).Value = CDate(dtTmp.Rows(i).Item("HACCHU_DT")).ToShortDateString           '発注日
            Else
                Me.KOJI_IKKATU.Cells(i, 4).Value = Nothing
            End If

            'Me.KOJI_IKKATU.Cells(i, 5).Value = dtTmp.Rows(i).Item("KOJI_NO")            '工事No.
            Me.KOJI_IKKATU.Cells(i, 6).Value = dtTmp.Rows(i).Item("KOJI_ST")            '工事状態
            Me.KOJI_IKKATU.Cells(i, 7).Value = dtTmp.Rows(i).Item("KOJI_NM")            '工事名
            Me.KOJI_IKKATU.Cells(i, 8).Value = dtTmp.Rows(i).Item("POST_NM_KANJI")      '担当部署
            Me.KOJI_IKKATU.Cells(i, 9).Value = dtTmp.Rows(i).Item("NM_KANJI_CONNECTION")   'NM_KANJI_CONNECTION
            Me.KOJI_IKKATU.Cells(i, 10).Value = dtTmp.Rows(i).Item("ARTICLE_CD")        '物件CD
            Me.KOJI_IKKATU.Cells(i, 11).Value = dtTmp.Rows(i).Item("ARTICLE_NM")        '物件名
            Me.KOJI_IKKATU.Cells(i, 12).Value = dtTmp.Rows(i).Item("ROOM_CD")           '部屋CD
            Me.KOJI_IKKATU.Cells(i, 13).Value = dtTmp.Rows(i).Item("ROOM_NM")           '部屋名
            Me.KOJI_IKKATU.Cells(i, 14).Value = dtTmp.Rows(i).Item("HACCHU_KINGAKU")    '発注額
            Me.KOJI_IKKATU.Cells(i, 15).Value = dtTmp.Rows(i).Item("SEIKYU_KINGAKU")    '請求額

        Next

        'spreadの行数指定
        Me.KOJI_IKKATU.ActiveSheetView.PageSize = dtTmp.Rows.Count


    End Sub

    ''' <summary>
    ''' reload Window State
    ''' </summary>
    ''' <remarks></remarks>
    Private Sub GoBackInputInit()
        Dim dt As DataTable = CType(Session(ComConst.GAMEN_ID.KOUJI_ANKEN_NYURYOKU & KOJITYEKA_TABLE), DataTable)

        With dt.Rows(0)

            Me.ddl_post_cd.SelectedValue = Util.ObjToString(.Item("POST_CD"))
            Me.txt_tanto_cd.Text = Util.ObjToString(.Item("EMP_CD"))
            Me.txt_tanto_nm.Text = Util.ObjToString(.Item("EMP_NM"))
            Me.gyosha_cd.Text = Util.ObjToString(.Item("GYOSHA_CD"))
            Me.gyosha_nm.Text = Util.ObjToString(.Item("GYOSHA_NM"))
            Me.ddl_koji_kb.SelectedValue = Util.ObjToString(.Item("KOJI_KB"))
            Me.TEHAI_DTF.Text = CDate(Util.ObjToString(.Item("TEHAI_DT_F"))).ToShortDateString
            Me.TEHAI_DTT.Text = CDate(Util.ObjToString(.Item("TEHAI_DT_T"))).ToShortDateString
            Me.HACCHU_DTF.Text = CDate(Util.ObjToString(.Item("HACCHU_DT_F"))).ToShortDateString
            Me.HACCHU_DTT.Text = CDate(Util.ObjToString(.Item("HACCHU_DT_T"))).ToShortDateString
            Me.ddl_kouji_st.SelectedValue = Util.ObjToString(.Item("KOJI_ST"))
            If CBool(Util.ObjToString(.Item("KOJI_YOTEI").Equals("True"))) Then
                chk_kouji.Checked = True

            Else
                chk_kouji.Checked = False
            End If

        End With

    End Sub

    ''' <summary>
    ''' Save Window State
    ''' </summary>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Private Function SaveFormValue() As DataTable
        Dim dt As New DataTable
        dt.Columns.Add("POST_CD", Type.GetType("System.String"))        '部署CD
        dt.Columns.Add("EMP_CD", Type.GetType("System.String"))         '担当者CD
        dt.Columns.Add("EMP_NM", Type.GetType("System.String"))         '担当者NM
        dt.Columns.Add("GYOSHA_CD", Type.GetType("System.String"))       'gyosha_cd
        dt.Columns.Add("GYOSHA_NM", Type.GetType("System.String"))       'gyosha_nm
        dt.Columns.Add("KOJI_KB", Type.GetType("System.String"))        '工事区分
        dt.Columns.Add("TEHAI_DT_F", Type.GetType("System.DateTime"))    '手配日(From)
        dt.Columns.Add("TEHAI_DT_T", Type.GetType("System.DateTime"))      '手配日(To)
        dt.Columns.Add("HACCHU_DT_F", Type.GetType("System.DateTime"))   '発注日(From)
        dt.Columns.Add("HACCHU_DT_T", Type.GetType("System.DateTime"))     '発注日(To)
        dt.Columns.Add("KOJI_ST", Type.GetType("System.String"))     '工事状態
        dt.Columns.Add("KOJI_YOTEI", Type.GetType("System.String"))     '工事状態CHECK

        Dim dr As DataRow = dt.NewRow
        dr("POST_CD") = Me.ddl_post_cd.SelectedValue
        dr("EMP_CD") = Me.txt_tanto_cd.Text
        dr("EMP_NM") = Me.txt_tanto_nm.Text
        dr("GYOSHA_CD") = Me.gyosha_cd.Text
        dr("GYOSHA_NM") = Me.gyosha_nm.Text
        dr("KOJI_KB") = Me.ddl_koji_kb.SelectedValue
        dr("TEHAI_DT_F") = Me.TEHAI_DTF.Text
        dr("TEHAI_DT_T") = Me.TEHAI_DTT.Text
        dr("HACCHU_DT_F") = Me.HACCHU_DTF.Text
        dr("HACCHU_DT_T") = Me.HACCHU_DTT.Text
        dr("KOJI_ST") = Me.ddl_kouji_st.SelectedValue
        dr("KOJI_YOTEI") = Me.chk_kouji.Checked
        dt.Rows.Add(dr)

        Return dt

    End Function
#End Region

#Region "Save Form"
    ''' <summary>
    ''' Save Form
    ''' </summary>
    ''' <param name="array0"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Private Function Transdata(ByVal array0() As Integer) As DataTable
        Dim rowcount As Integer = KOJI_IKKATU.Rows.Count
        Dim NewdtIkkatu As New DataTable("KOJI_IKKATU")

        With NewdtIkkatu
            .Columns.Add("ROWID_ANKEN", Type.GetType("System.String"))
            .Columns.Add("ROWID_MITUMORI", Type.GetType("System.String"))
            .Columns.Add("ROWID_HACCHU", Type.GetType("System.String"))
            .Columns.Add("TAISHO_FG", Type.GetType("System.String"))    '対象フラグ
            .Columns.Add("GYOSHA_CD", Type.GetType("System.String"))    '業者CD
            .Columns.Add("GYOSHA_NM", Type.GetType("System.String"))    '業者名    
            .Columns.Add("TEHAI_DT", Type.GetType("System.String"))       '手配日
            .Columns.Add("HACCHU_DT", Type.GetType("System.String"))      '発注日
            .Columns.Add("KOJI_NO", Type.GetType("System.String"))      '工事NO.
            .Columns.Add("KOJI_ST", Type.GetType("System.String"))      '工事状態
            .Columns.Add("KOJI_NM", Type.GetType("System.String"))      '工事名
            .Columns.Add("POST_NM_KANJI", Type.GetType("System.String"))    '担当部署
            .Columns.Add("NM_KANJI_CONNECTION", Type.GetType("System.String"))  '担当者
            .Columns.Add("ARTICLE_CD", Type.GetType("System.String"))       '物件CD   
            .Columns.Add("ARTICLE_NM", Type.GetType("System.String"))       '物件名
            .Columns.Add("ROOM_CD", Type.GetType("System.String"))          '部屋CD
            .Columns.Add("ROOM_NM", Type.GetType("System.String"))          '部屋名    
            .Columns.Add("HACCHU_KINGAKU", Type.GetType("System.Int32"))    '発注金額
            .Columns.Add("SEIKYU_KINGAKU", Type.GetType("System.Int32"))    '請求金額
            .Columns.Add("MITUMORI_NO", Type.GetType("System.Int32"))       '見積No

        End With

        For i As Integer = 0 To rowcount - 1
            Dim dr As DataRow = NewdtIkkatu.NewRow
            ' dr("ROWID_ANKEN") = Util.ObjToString(rowid_anken)
            dr("ROWID_ANKEN") = String.Empty
            dr("ROWID_MITUMORI") = String.Empty
            dr("ROWID_HACCHU") = String.Empty
            dr("TAISHO_FG") = array0(i)
            dr("GYOSHA_CD") = KOJI_IKKATU.Cells(i, 1).Value
            dr("GYOSHA_NM") = KOJI_IKKATU.Cells(i, 2).Value
            If Not IsDBNull(KOJI_IKKATU.Cells(i, 3).Value) Then
                dr("TEHAI_DT") = CDate(KOJI_IKKATU.Cells(i, 3).Value).ToShortDateString
            Else
                dr("TEHAI_DT") = Nothing
            End If
            If Not IsDBNull(KOJI_IKKATU.Cells(i, 4).Value) Then
                dr("HACCHU_DT") = CDate(KOJI_IKKATU.Cells(i, 4).Value).ToShortDateString
            Else
                dr("HACCHU_DT") = Nothing
            End If
            dr("KOJI_NO") = KOJI_IKKATU.Cells(i, 5).Value
            dr("KOJI_ST") = KOJI_IKKATU.Cells(i, 6).Value
            dr("KOJI_NM") = KOJI_IKKATU.Cells(i, 7).Value
            dr("POST_NM_KANJI") = KOJI_IKKATU.Cells(i, 8).Value
            dr("NM_KANJI_CONNECTION") = KOJI_IKKATU.Cells(i, 9).Value
            dr("ARTICLE_CD") = KOJI_IKKATU.Cells(i, 10).Value
            dr("ARTICLE_NM") = KOJI_IKKATU.Cells(i, 11).Value
            dr("ROOM_CD") = KOJI_IKKATU.Cells(i, 12).Value
            dr("ROOM_NM") = KOJI_IKKATU.Cells(i, 13).Value
            dr("HACCHU_KINGAKU") = KOJI_IKKATU.Cells(i, 14).Value
            dr("SEIKYU_KINGAKU") = KOJI_IKKATU.Cells(i, 15).Value
            '   dr("MITUMORI_NO") = Util.ObjToString(Me.MITUMORI_NO)

            NewdtIkkatu.Rows.Add(dr)

        Next

        Return NewdtIkkatu
    End Function
#End Region

End Class